
const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    // LIFE-CYCLE CALLBACKS:
    private animationComponent:cc.Animation

    onLoad () {
        cc.game.setFrameRate(30);  // 设置帧率

        // 调用动画
        this.animationComponent = this.getComponent(cc.Animation);

        
    }

    start () {
        // 运动
        cc.tween(this.node)
        .to(1, { position: cc.v3(0, this.node.y), rotation: 360 }, { easing:'quadIn' })
        .delay(1)
        .to(1, { position: cc.v3(0, -100) })
        .call(() => {
            // 用获取的组件执行动画
            this.animationComponent.play('boom');
            this.animationComponent.on('stop', (event) => {
                // 处理停止播放时的逻辑
                this.node.active = false;
            }, this);
         })
         .start();
    }

    // update (dt) {}
}
